import React, { Component } from 'react'

export default class Example extends Component {
  constructor(props) {
    super(props)
    this.addCount = this.addCount.bind(this)
    this.state = {
      count: 0
    }
  }

  addCount() {
    this.setState({ count: this.state.count + 1 })
  }

  render() {
    return (
      <>
        <p>You clicked {this.state.count} times</p>
        <button onClick={this.addCount}>Click me</button>
      </>
    )
  }
}
